library reminder;

import 'package:flutter/material.dart';
import 'top_reminder.dart';
import 'toasty.dart';

///全局轻提示
class Reminder {
  static bool isUseToasty = false;

  static void info(
    BuildContext context,
    String content, {
    int duration = 3,
    double height = 90.0,
    double textSize = 18.0,
    textColor: Colors.white,
  }) {
    isUseToasty
        ? Toasty.info(context, content)
        : TopReminder.info(context, content,
            duration: duration,
            height: height,
            textSize: textSize,
            textColor: textColor);
  }

  static void success(
    BuildContext context,
    String content, {
    int duration = 3,
    double height = 90.0,
    double textSize = 18.0,
    textColor: Colors.white,
  }) {
    isUseToasty
        ? Toasty.success(context, content)
        : TopReminder.success(context, content,
            duration: duration,
            height: height,
            textSize: textSize,
            textColor: textColor);
  }

  static void warning(
    BuildContext context,
    String content, {
    int duration = 3,
    double height = 90.0,
    double textSize = 18.0,
    textColor: Colors.black,
  }) {
    isUseToasty
        ? Toasty.warning(context, content)
        : TopReminder.warning(context, content,
            duration: duration,
            height: height,
            textSize: textSize,
            textColor: textColor);
  }

  static void error(
    BuildContext context,
    String content, {
    int duration = 3,
    double height = 90.0,
    double textSize = 18.0,
    textColor: Colors.white,
  }) {
    isUseToasty
        ? Toasty.error(context, content)
        : TopReminder.error(context, content,
            duration: duration,
            height: height,
            textSize: textSize,
            textColor: textColor);
  }
}
